public class ZhaiZhiJie03 {
    public static void main(String[] args) {
        Item apple = new Item("apple", 2.5);
        Item banana = new Item("banana", 3.5);
        System.out.println(Item.getSum());
    }
}

class Item
{
    private String name;
    private double price;
    private static double sum;
    public Item(String name, double price)
    {
        this.name = name;
        this.price = price;
        sum += this.price;
    }
    public static double getSum()
    {
        return sum;
    }
}